﻿using System;
using System.Collections.Generic;
using System.Text;
using FunctionalCLR;
using FunctionalCLR.Core;

namespace FunctionalCLR.Core.Function.String {
    public class CompareNode : FuncNode {

        public CompareNode()
            : base() {
            base.Value = "compare";
        }

        public override FuncNode GetReversedFunction(int index) {
            throw new NotImplementedException();
        }

        public override object Evaluate() {
            string left = Children[0].Evaluate().ToString();
            string right = Children[1].Evaluate().ToString();

            return left.CompareTo(right);
        }
    }
}
